Skip to content

feat: implement ability to search when selecting datasets - #153

Merged
ralvarez-dg merged 5 commits into
mainfrom
task/implement-search-in-dataset-selector
Sep 16, 2026
Merged

ralvarez-dg merged 5 commits into
mainfrom
task/implement-search-in-dataset-selector

Conversation

@timothy-mugo

Copy link
Copy Markdown
Contributor

Description

Type of change

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change (BREAKING CHANGE:)
  • Refactor / chore (refactor: / chore:)
  • Documentation update (docs:)

Affected package(s)

  • @devgateway/dvz-wp-commons
  • @devgateway/create-wp-customizer
  • @devgateway/upgrade-wp-customizer
  • plugins/wp-react-blocks-plugin
  • plugins/wp-react-custom-api
  • plugins/wp-react-custom-rest-menu
  • Other plugin / theme / Docker (no changeset needed)

Checklist

  • PR title follows Conventional Commits format
  • pnpm build passes locally
  • No hardcoded credentials, internal URLs, client names, or PII introduced
  • Any new dependency has a GPL-2.0-or-later-compatible license (MIT, BSD, Apache-2.0, ISC are all compatible)

@timothy-mugo
timothy-mugo marked this pull request as ready for review September 15, 2026 14:18
@timothy-mugo
timothy-mugo requested review from ralvarez-dg and a lite review from Copilot September 15, 2026 14:18
@timothy-mugo
timothy-mugo marked this pull request as draft September 15, 2026 14:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The shared selector has unresolved chart reset and duplicate metadata-loading issues, plus an unused import.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds a reusable searchable dataset selector across visualization blocks and map layers.

Changes:

  • Introduces and exports DatasetSelector.
  • Replaces existing dataset controls.
  • Updates dependencies and adds a changeset.
File summaries
File Summary
pnpm-lock.yaml Updates workspace dependency metadata.
plugins/wp-react-blocks-plugin/blocks/package.json Updates the commons dependency.
plugins/wp-react-blocks-plugin/blocks/map/BlockEdit.js Integrates the shared selector.
plugins/wp-react-blocks-plugin/blocks/grouped-bars/BlockEdit.js Integrates the shared selector.
plugins/wp-react-blocks-plugin/blocks/filter/BlockEdit.js Integrates the shared selector.
plugins/wp-react-blocks-plugin/blocks/data-paragraph/BlockEdit.js Integrates the shared selector.
plugins/wp-react-blocks-plugin/blocks/d3Map/layers/LatLong.jsx Integrates the shared selector.
plugins/wp-react-blocks-plugin/blocks/d3Map/layers/Flow.jsx Integrates the shared selector.
plugins/wp-react-blocks-plugin/blocks/d3Map/layers/Data.jsx Integrates the shared selector.
plugins/wp-react-blocks-plugin/blocks/charts/BlockEdit.js Integrates the shared selector.
plugins/wp-react-blocks-plugin/blocks/big-number/BlockEdit.js Integrates the shared selector.
plugins/wp-react-blocks-plugin/blocks/big-number-trend/BlockEdit.js Integrates the shared selector.
plugins/wp-react-blocks-plugin/blocks/big-filter/BlockEdit.js Integrates the shared selector.
packages/commons/src/index.js Exports DatasetSelector.
packages/commons/src/DatasetSelector.jsx Implements searchable dataset selection.
.changeset/sixty-queens-invent.md Documents the commons package release.
Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file
  • Files reviewed: 15/16 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/commons/src/DatasetSelector.jsx
Comment thread packages/commons/src/DatasetSelector.jsx Outdated
Comment thread plugins/wp-react-blocks-plugin/blocks/map/BlockEdit.js
@timothy-mugo
timothy-mugo force-pushed the task/implement-search-in-dataset-selector branch from 4242c5b to 3b2415a Compare September 15, 2026 16:26
@timothy-mugo
timothy-mugo marked this pull request as ready for review September 15, 2026 18:57
Copilot AI review requested due to automatic review settings September 15, 2026 18:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved selector integration, stale dataset state, loading-state, and unused-import issues remain.

Get a fresh assessment by requesting another Copilot review.

Review details

Files not reviewed (1)

  • pnpm-lock.yaml: Generated file

Suppressed comments (11)

packages/commons/src/DatasetSelector.jsx:9

  • This selector is only wired into map/BlockEdit; grouped-bars/BlockEdit.js and data-paragraph/BlockEdit.js still render the old SelectControl for Superset datasets, so users of those blocks still cannot search. Please update those dataset controls as part of this feature or narrow the feature scope.
export const DatasetSelector = (props) => {
    const {
        setAttributes,
        setState,
        loadMetadata,

packages/commons/src/index.js:45

  • The new selector is not wired into all existing Superset dataset pickers: data-paragraph/BlockEdit.js:198-205 and grouped-bars/BlockEdit.js:353-365 still render SelectControl, so those blocks cannot search datasets. Please migrate those call sites as well, or narrow the feature scope in the PR description.
export { DatasetSelector } from './DatasetSelector';

plugins/wp-react-blocks-plugin/blocks/big-filter/BlockEdit.js:169

  • datasets always contains the Select Dataset sentinel, so this length check is never zero while the API request is pending. Consequently the new combobox never shows its loading state; check the raw this.state.datasets (or an explicit loading flag) instead.
                                        isLoading={datasets.length === 0}

plugins/wp-react-blocks-plugin/blocks/big-number-trend/BlockEdit.js:162

  • datasets always contains the Select Dataset sentinel, so this length check is never zero while the API request is pending. Consequently the new combobox never shows its loading state; check the raw this.state.datasets (or an explicit loading flag) instead.
                                        isLoading={datasets.length === 0}

plugins/wp-react-blocks-plugin/blocks/big-number/BlockEdit.js:144

  • datasets always contains the Select Dataset sentinel, so this length check is never zero while the API request is pending. Consequently the new combobox never shows its loading state; check the raw this.state.datasets (or an explicit loading flag) instead.
                                        isLoading={datasets.length === 0}

plugins/wp-react-blocks-plugin/blocks/charts/BlockEdit.js:421

  • datasets always contains the Select Dataset sentinel, so this length check is never zero while the API request is pending. Consequently the new combobox never shows its loading state; check the raw this.state.datasets (or an explicit loading flag) instead.
                                            isLoading={datasets.length === 0}

plugins/wp-react-blocks-plugin/blocks/d3Map/layers/Data.jsx:314

  • This layer also prepends a Select Dataset option, so allDatasets.length === 0 is never true and the combobox cannot indicate that metadata is still loading. Pass an explicit loading state from the metadata owner instead of deriving it from this placeholder-inclusive list.
                            isLoading={allDatasets.length === 0}

plugins/wp-react-blocks-plugin/blocks/d3Map/layers/Flow.jsx:294

  • This layer also prepends a Select Dataset option, so allDatasets.length === 0 is never true and the combobox cannot indicate that metadata is still loading. Pass an explicit loading state from the metadata owner instead of deriving it from this placeholder-inclusive list.
                        isLoading={allDatasets.length === 0}

plugins/wp-react-blocks-plugin/blocks/d3Map/layers/LatLong.jsx:255

  • This layer also prepends a Select Dataset option, so allDatasets.length === 0 is never true and the combobox cannot indicate that metadata is still loading. Pass an explicit loading state from the metadata owner instead of deriving it from this placeholder-inclusive list.
                        isLoading={allDatasets.length === 0}

plugins/wp-react-blocks-plugin/blocks/filter/BlockEdit.js:260

  • datasets always contains the Select Dataset sentinel, so this length check is never zero while the API request is pending. Consequently the new combobox never shows its loading state; check the raw this.state.datasets (or an explicit loading flag) instead.
                                    isLoading={datasets.length === 0}

plugins/wp-react-blocks-plugin/blocks/map/BlockEdit.js:12

  • ComboboxControl is imported here but the file now renders the shared DatasetSelector instead, so this named import is unused and will fail the repository's lint rules. Remove it from the import list.
  ComboboxControl,
  • Files reviewed: 14/15 changed files
  • Comments generated: 4
  • Review effort level: Lite

app,
datasets
} = props;
const [ filterValue, setFilterValue ] = useState("");
onChange={(newDatasetId) => {
onChangeProperty("dvzProxyDatasetId", newDatasetId)
}}
options={this.state.filteredDatasets || allDatasets}
onChange={(newDatasetId) => {
onChangeProperty("dvzProxyDatasetId", newDatasetId)
}}
options={this.state.filteredDatasets || allDatasets}
onChange={(newDatasetId) => {
onChangeProperty("dvzProxyDatasetId", newDatasetId)
}}
options={this.state.filteredDatasets || allDatasets}
@ralvarez-dg
ralvarez-dg merged commit 7315043 into main Sep 16, 2026
3 checks passed
timothy-mugo pushed a commit that referenced this pull request Sep 21, 2026
…set-selector

feat: implement ability to search when selecting datasets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants